package com.woniuxy.controller;

import com.woniuxy.entity.RbacManager;
import com.woniuxy.service.ManagerService;
import com.woniuxy.utils.Resout;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/manager")
public class ManagerController {
    @Autowired(required=false)
    private ManagerService managerService;
    @PostMapping("/findAll/{currentPage}/{pageSize}")
    public Resout findAll(@PathVariable("currentPage") int currentPage,@PathVariable("pageSize") int pageSize,@RequestBody RbacManager manager){
         return managerService.findAll(currentPage,pageSize,manager);
    }
    @PostMapping("/delete/{id}")
public Resout delete(@PathVariable("id") int id){
        return managerService.deleteById(id);
}
    @PostMapping("/add")
    public Resout add(@RequestBody RbacManager rbacManager){
        return managerService.add(rbacManager);
    }
    @PostMapping("/update")
    public Resout updata(@RequestBody RbacManager rbacManager){
        return managerService.update(rbacManager);
    }
    @PostMapping("/login")
    public Resout login(@RequestBody RbacManager rbacManagerr){
        return managerService.login(rbacManagerr);
    }
}
